package org.jeecg.moudles.inventory.controller;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.jeecg.moudles.inventory.entity.Damage;
import org.jeecg.moudles.inventory.service.DamageService;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 *  报损清单控制器
 *
 * @author Ruka
 * @since 2022-04-26
 */
@RestController
@RequestMapping("/damage")
public class DamageController {

    @Resource
    private DamageService damageService;

    @GetMapping("/page")
    public ResponseEntity<?> findGoodsPage(@RequestParam(defaultValue = "1") Integer pageNUm,
                                           @RequestParam(defaultValue = "10") Integer pageSize,
                                           @RequestParam(required = false) Integer pId){
        Page<Damage> damageList = damageService.page(pageNUm,pageSize,pId);
        return ResponseEntity.ok(damageList);
    }
}

